package com.spdb.spdbfl.data;


import com.spdb.spdbfl.config.BaseConfig;
import com.spdb.spdbfl.restful.lease.LeaseIT;
import com.spdb.spdbfl.restful.project.ProjectIT;
import com.spdb.spdbfl.utils.Login;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 * 造数据
 */
public class CaseData {

    private static final String domainUrl = BaseConfig.domainUrl;
    public static final String operationCenterUrl = "/operationCenter/operationCenter";
    static String token = "";

    public CaseData() {
    }

    @BeforeClass(description = "登录")
    public void setUp() throws Exception {
        Login login = new Login();
        login.getToken("lium", "1");
    }

    /**
     * 造数据流程
     */
    @Test()
    public static void createData() throws Exception {
        LeaseIT.getTokenAndUrl();
        //租赁物
        LeaseIT.updateLeaseItem();
        //资产
        LeaseIT.updateLeaseAssets();
        //账面价值
        LeaseIT.updateAssetsValue();
        //资产分类
        LeaseIT.addLeaseObject();
        //出厂信息
        LeaseIT.updateAssetsFactory();
        //权属及注册
        LeaseIT.updateAssetsOwner();
        //使用地点
        LeaseIT.updateAssetsPlace();
        //新增项目
        ProjectIT.getTokenAndUrl();
        ProjectIT.newProject();
        //新建审批单
        ProjectIT.savePrjAppr();
        ProjectIT.saveProjectApprovalInfo();
        ProjectIT.rptStsToBrain("01", "draft");
        //上传尽调报告、租赁物清单
        ProjectIT.upload("13202-1", "尽调报告");
        ProjectIT.upload("13202-0", "租赁物清单");
        //保存项目方案
        ProjectIT.savePlan();
        //提交审批
        ProjectIT.start();
        ProjectIT.rptStsToBrain("02", "draft");
    }



}
